VERSION 5.00
Begin VB.Form CondomsGivenByCounForm 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Back_Button 
      Caption         =   "Back"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   5
      Top             =   7560
      Width           =   1935
   End
   Begin VCT.TouchKeyPad TouchKeyPad1 
      Height          =   4095
      Left            =   840
      TabIndex        =   4
      Top             =   4560
      Width           =   3555
      _ExtentX        =   6271
      _ExtentY        =   7223
   End
   Begin VCT.ClientPlanCtrl PLAN 
      Height          =   3855
      Left            =   300
      TabIndex        =   3
      Top             =   180
      Width           =   11415
      _ExtentX        =   20135
      _ExtentY        =   6800
   End
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   2
      Top             =   5520
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Finish"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   4500
      Width           =   1935
   End
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   6540
      Width           =   1935
   End
End
Attribute VB_Name = "CondomsGivenByCounForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private TempString As String

'COUNCOND - Number of condoms given out by the counselor
'Back to GAVERESU

Private Sub Back_Button_Click()
   GAVERESU = ""
   COUNCOND = -1
   GaveResultsForm.Show
   Unload Me
End Sub

Private Sub Cancel_Button_Click()
   VCTStageForm.Show
   Unload Me
End Sub

Private Sub Clear_Button_Click()
   TempString = ""
   COUNCOND = -1
   PLAN.UpdateData
   Next_Button.Enabled = False
   TouchKeyPad1.Enabled = True
End Sub

Private Sub Form_Load()
   TempString = ""
   PLAN.UpdateData
   PLAN.SetStar (6)
   Next_Button.Enabled = False
End Sub

Private Sub Next_Button_Click()
   'make some adjustments to the data to conform with field sizes and data types
   While Len(COUNCOND) < 3
      COUNCOND = "0" & COUNCOND
   Wend
   
'   If REFTO7 = "0" Then
   PRINTED = "1"
'   Else
'      PRINTED = "0"
'   End If
   
   'write he data to the database
   CnUser.Open ConnectString
   Cmd.CommandText = "UPDATE client SET " & _
                     "DISCOR  = '" & DISCOR & "', " & "RRPLAN0 = '" & RRPLAN0 & "', " & _
                     "RRPLAN1 = '" & RRPLAN1 & "', " & "RRPLAN2 = '" & RRPLAN2 & "', " & _
                     "RRPLAN3 = '" & RRPLAN3 & "', " & "RRPLAN4 = '" & RRPLAN4 & "', " & _
                     "RRPLAN5 = '" & RRPLAN5 & "', " & "RRPLAN6 = '" & RRPLAN6 & "', " & _
                     "RRPLAN7 = '" & RRPLAN7 & "', " & "RRPLAN8 = '" & RRPLAN8 & "', " & _
                     "RRPLAN9 = '" & RRPLAN9 & "', " & "RRPLAN10 = '" & RRPLAN10 & "', " & _
                     "RRPLAN11 = '" & RRPLAN11 & "', " & "RRPLAN99 = '" & RRPLAN99 & "', " & _
                     "REFTO0 = '" & REFTO0 & "', " & "REFTO1 = '" & REFTO1 & "', " & _
                     "REFTO2 = '" & REFTO2 & "', " & "REFTO3 = '" & REFTO3 & "', " & _
                     "REFTO4 = '" & REFTO4 & "', " & "REFTO5 = '" & REFTO5 & "', " & _
                     "REFTO6 = '" & REFTO6 & "', " & "REFTO7 = '" & REFTO7 & "', " & _
                     "REFTO8 = '" & REFTO8 & "', " & "REFTO98 = '" & REFTO98 & "', " & _
                     "REFTO99 = '" & REFTO99 & "', " & "COUNSELD = '" & COUNSELD & "', " & _
                     "GAVETEST = '" & GAVETEST & "', " & "GAVERESU = '" & GAVERESU & "', " & _
                     "COUNCOND = " & COUNCOND & ", " & "TIMEPOST = '" & Format(Now(), "hh:mm:ss") & "', " & "PRINTED = '" & PRINTED & "' " & _
                     "WHERE VISITID = " & VISITID
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   Cmd.Execute
   CnUser.Close

   'Add the additional variables for Lighthouse
   If ORGANIZATION = "LIGHTHOUSE" Then
   CnUser.Open ConnectString
   Cmd.CommandText = "UPDATE client SET " & _
                     "REFTO9 = '" & REFTO9 & "', " & "REFTO10 = '" & REFTO10 & "', " & "REFTO11 = '" & REFTO11 & "', " & "RRPLAN12 = '" & RRPLAN12 & "' " & _
                     "WHERE VISITID = " & VISITID
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   Cmd.Execute
   CnUser.Close
   
   End If


'   If REFTO7 = "1" Then
'      'Don't print the form until the client has finished with the MACRO clinic session
'      VCTStageForm.Show
'   Else
'      PrintTestForm.Show
'   End If

   If ORGANIZATION = "MACRO" Then
      PrintTestForm.Show
   Else
      If ORGANIZATION = "LIGHTHOUSE" Then
         SavingVCTDataForm.Show
      End If
   End If
   Unload Me
   
End Sub

Private Sub TouchKeyPad1_NumPressed()
   TempString = TempString & TouchKeyPad1.KeyNum
   COUNCOND = TempString
   PLAN.UpdateData
   Next_Button.Enabled = True
   If Len(TempString) >= 3 Then
      TouchKeyPad1.Enabled = False
   End If
End Sub
